cmake_minimum_required(VERSION 3.22.1)
project(get_property_test)

get_property(dirs DIRECTORY ${CMAKE_CURRENT_SRC_DIR} PROPERTY INCLUDE_DIRECTORIES)
message("# Get current directory property INCLUDE_DIRECTORIES: ${dirs}")

include_directories(test)
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SRC_DIR} PROPERTY INCLUDE_DIRECTORIES)
message("# Get current directory property INCLUDE_DIRECTORIES after include 'test': ${dirs}")

get_cmake_property(role CMAKE_ROLE)
message("# Run CMake in mode: ${role}")

get_cmake_property(not_found_property CMAKE_NOT_EXIST_PROPERTY)
message("# Get one non exist property: ${not_found_property}")

get_property(role GLOBAL PROPERTY CMAKE_ROLE)
message("# Get GLOBAL property CMAKE_ROLE: ${role}")

#get_directory_property(vars VARIABLES)
#message("# Get current DIRECTORY property VARIABLES: ${vars}")

#add_subdirectory(test)
#get_directory_property(vars DIRECTORY test VARIABLES)
#message("# Get test DIRECTORY property VARIABLES: ${vars}")


#add_executable(hello .)
#get_target_property(target_name hello NAME)
#message("# Get target property NAME: ${target_name}")


#get_property(target_name TARGET hello PROPERTY NAME)
#message("# Get target property NAME: ${target_name}")

add_subdirectory(test)
get_source_file_property(file_full_path main.cpp LOCATION)
message("# Get source file property LOCATION: ${file_full_path}")

get_source_file_property(file_full_path test/test.cpp DIRECTORY test LOCATION)
message("# Get source file test/test.cpp from directory test property LOCATION: ${file_full_path}")

get_source_file_property(file_full_path test/test.cpp TARGET_DIRECTORY test LOCATION)
message("# Get source file test/test.cpp from target test property LOCATION: ${file_full_path}")

#add_executable(main main.cpp)
